const { lessorsModel } = require('./models/lessorsModel');



module.exports = {
    //获取出租方数据
    getLessors: async (lessorsId) => {
        console.log('成功进入第三层获取出租方数据')
        const result = await lessorsModel.find(lessorsId);
        console.log(result)
        return result;
    },

    //验证注册用户名是否重复
    isAccess: async function (account) {
        const data = await lessorsModel.find({ account });
        return data;
    },
    //注册
    register: async lessors => {
        return await lessorsModel.create(lessors);
    },
    //登陆
    login: async function (lessors) {
        const data = await lessorsModel.find(lessors);
        return data;
    }

}
